From 2f264dba7168f0e3519b3b53148442001642e309 Mon Sep 17 00:00:00 2001 From: Woazboat Date: Tue, 28 Apr 2015 02:54:45 +0200 Subject: Changed Vector3 Equals function to avoid using memcmp --- src/Vector3.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Vector3.h b/src/Vector3.h index f1fb2d257..ede6cc851 100644 --- a/src/Vector3.h +++ b/src/Vector3.h @@ -126,11 +126,7 @@ public: { // Perform a bitwise comparison of the contents - we want to know whether this object is exactly equal // To perform EPS-based comparison, use the EqualsEps() function - return ( - (memcmp(&x, &a_Rhs.x, sizeof(x)) == 0) && - (memcmp(&y, &a_Rhs.y, sizeof(y)) == 0) && - (memcmp(&z, &a_Rhs.z, sizeof(z)) == 0) - ); + return !((x != a_Rhs.x) || (y != a_Rhs.y) || (z != a_Rhs.z)); } inline bool EqualsEps(const Vector3 & a_Rhs, T a_Eps) const -- cgit v1.2.3